package top.withwings.bonus.bonus.pojo.bonus.rule;

import top.withwings.bonus.bonus.pojo.BonusForm;
import top.withwings.bonus.bonus.pojo.Rate;

import java.util.LinkedHashMap;

public class OnSaleBonusRule extends SingleBonusRule {

    public static final String TYPE = "ON-SALE";

    public OnSaleBonusRule(int id, String name, LinkedHashMap<String, Double> paramMap) {
        super(id, name, paramMap);
        this.type = TYPE;
    }

    @Override
    public Rate applyOn(BonusForm bonusForm) {
        return new Rate(Rate.TYPE_NORMAL, this.paramMap.get("y"));
    }
}